MailItem = fgui.extension_class(GButton)

--注意这里不是构造函数，是当组件已经（通过XML）构建完毕后调用的
function MailItem:ctor()
	print("MailItem", self);
	print(self:GetChild("timeText").asTextField);
    MailItem._timeText = self:GetChild("timeText").asTextField;
	MailItem._readController = self:GetController("IsRead");
	MailItem._fetchController = self:GetController("c1");
	MailItem._trans = self:GetTransition("t0");
end

function MailItem:setTime(value)
	MailItem._timeText.text = value;
end

function MailItem:setRead(value)
	MailItem._readController.selectedIndex = value and 1 or 0;
end

function MailItem:setFetched(value)
	MailItem._fetchController.selectedIndex = value and 1 or 0;
end

function MailItem:PlayEffect(delay)
	MailItem.visible = false;
	print(MailItem._trans);
	MailItem._trans:Play();
end